import './index.scss'
import {useNavigate} from "react-router-dom";
import React from "react";

interface Props {
    data?: Array<any>
}

const ArticleInner = React.memo(({data = []}: Props) => {
    const n = useNavigate();
    return (
        <div className="article-inner-box">
            {
                data.map(v => {
                    return (
                        <div key={v.id}>
                            <img src={v.cover_url} alt="" onClick={() => n(`/article/${v.id}`)}/>
                            <p>{v.name}</p>
                        </div>
                    )
                })
            }
        </div>
    )
})

export default ArticleInner;